namespace V2TEK.NET.SH.Silverlight.Calendar
{
    using System;

    internal sealed class WorkingDay : CalendarPeriod
    {
        private System.DayOfWeek _day;

        public WorkingDay(WorkCalendar calendar, bool working, System.DayOfWeek day) : base(calendar, working)
        {
            this._day = day;
            if (calendar.IsBaseCalendar)
            {
                base.Standard = true;
            }
        }

        internal override DateTime Add(DateTime time, ref long duration)
        {
            return base.AddWorkInDay(time, ref duration);
        }

        public override bool Equals(object obj)
        {
            if (!(obj is WorkingDay))
            {
                return false;
            }
            WorkingDay p = (WorkingDay) obj;
            return (((p._isWorking == base._isWorking) && (p._day == this._day)) && base.SameWorkingTimes(p));
        }

        public override int GetHashCode()
        {
            return base.GetHashCode();
        }

        internal override DateTime Remove(DateTime time, ref long duration)
        {
            return base.RemoveWorkInDay(time, ref duration);
        }

        internal override long WorkBetween(DateTime time, DateTime end)
        {
            return base.WorkBetweenHours(time, end);
        }

        public System.DayOfWeek DayOfWeek
        {
            get
            {
                return this._day;
            }
        }
    }
}

